#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int a[10];
	for (int i = 0; i < 10; i++)
	{
		scanf("%d ", &a[i]);
	}
	int max_num = 0;
	scanf("%d", &max_num);
	int maxmax_num = max_num + 30;
	int apple_num = 0;
	for (int i = 0; i < 10; i++)
	{
		if (maxmax_num >= a[i])
			apple_num++;
	}
	cout << apple_num << endl;
	return 0;
}